<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>江顺食品零售商城</title>

    <link href="/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css"/>
    <link href="/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css"/>

    <link href="/basic/css/demo.css" rel="stylesheet" type="text/css"/>

    <link href="/css/hmstyle.css" rel="stylesheet" type="text/css"/>
    <link href="/css/skin.css" rel="stylesheet" type="text/css"/>
    <script src="/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="/AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/layui/css/layui.css"/>
    <script src="/layui/layui.js"></script>
    <script src="/js/common.js" type="text/javascript"></script>
</head>

<body>
<div class="hmtop">

    <th:block th:include="header"/>

    <div class="banner">
        <!--轮播 -->
        <div class="am-slider am-slider-default scoll" data-am-flexslider id="demo-slider-0">
            <ul class="am-slides">
                <li class="banner1"><a href="introduction.html"><img src="/images/ad1.jpg"/></a></li>
                <li class="banner2"><a><img src="/images/banner111.png"/></a></li>
                <li class="banner3"><a><img src="/images/banner111.png"/></a></li>
                <li class="banner4"><a><img src="/images/banner111.png"/></a></li>

            </ul>
        </div>
        <div class="clear"></div>
    </div>
    <div class="shopNav">
        <div class="slideall">

            <div class="long-title"><span class="all-goods">全部分类</span></div>

            <!--侧边导航 -->
            <div id="nav" class="navfull">
                <div class="area clearfix">
                    <div class="category-content" id="guide_2">

                        <div class="category">
                            <ul class="category-list ul" id="js_climit_li">

                            </ul>
                        </div>
                    </div>

                </div>
            </div>


            <!--轮播-->

            <script type="text/javascript">
                (function () {
                    $('.am-slider').flexslider();
                });

            </script>


            <!--小导航 -->
            <div class="am-g am-g-fixed smallnav">
                <div class="am-u-sm-3">
                    <a href="sort.html"><img src="images/navsmall.jpg"/>
                        <div class="title">商品分类</div>
                    </a>
                </div>
                <div class="am-u-sm-3">
                    <a href="#"><img src="images/huismall.jpg"/>
                        <div class="title">大聚惠</div>
                    </a>
                </div>
                <div class="am-u-sm-3">
                    <a href="#"><img src="images/mansmall.jpg"/>
                        <div class="title">个人中心</div>
                    </a>
                </div>
                <div class="am-u-sm-3">
                    <a href="#"><img src="images/moneysmall.jpg"/>
                        <div class="title">投资理财</div>
                    </a>
                </div>
            </div>

            <!--走马灯 -->

            <div class="marqueen">
                <span class="marqueen-title">商城头条</span>
                <div class="demo">

                    <ul>
                        <li class="title-first"><a target="_blank" href="#">
                            <img src="images/TJ2.jpg"></img>
                            <span>[特惠]</span>商城爆品1分秒
                        </a></li>
                        <li class="title-first"><a target="_blank" href="#">
                            <span>[公告]</span>商城与广州市签署战略合作协议
                            <img src="images/TJ.jpg"></img>
                            <p>XXXXXXXXXXXXXXXXXX</p>
                        </a></li>

                        <div class="mod-vip" th:each="a1:${avatar}">
                            <div class="m-baseinfo" >
                                <a href="person/index.html">
                                    <img th:src="${a1.getAvatar()}">
                                </a>
                                <em>
                                    <span class="s-name" th:if="${session.currentUser != null}">Hi![[${session.currentUser.username}]]</span>
                                    <a href="#"><p>点击更多优惠活动</p></a>
                                </em>
                            </div>
                            <div class="member-logout">
                                <a class="am-btn-warning btn" href="/login"
                                   th:if="${session.currentUser == null}">登录</a>
                                <a class="am-btn-warning btn" href="/logout"
                                   th:if="${session.currentUser != null}">退出</a>
                                <a class="am-btn-warning btn" href="/register/page"
                                   th:if="${session.currentUser == null}">注册</a>
                                <a class="am-btn-warning btn" href="/information"
                                   th:if="${session.currentUser != null}">个人中心</a>
                            </div>
                            <div class="clear"></div>
                        </div>

                        <li><a target="_blank" href="#"><span>[特惠]</span>洋河年末大促，低至两件五折</a></li>
                        <li><a target="_blank" href="#"><span>[公告]</span>华北、华中部分地区配送延迟</a></li>
                        <li><a target="_blank" href="#"><span>[特惠]</span>家电狂欢千亿礼券 买1送1！</a></li>

                    </ul>
                    <div class="advTip"><img src="images/advTip.jpg"/></div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <script type="text/javascript">
            if ($(window).width() < 640) {
                function autoScroll(obj) {
                    $(obj).find("ul").animate({
                        marginTop: "-39px"
                    }, 500, function () {
                        $(this).css({
                            marginTop: "0px"
                        }).find("li:first").appendTo(this);
                    })
                }

                $(function () {
                    setInterval('autoScroll(".demo")', 3000);
                })
            }
        </script>
    </div>
    <div class="shopMainbg">
        <div class="shopMain" id="shopmain">

            <!--今日推荐 -->

            <div class="am-g am-g-fixed recommendation">
                <div class="clock am-u-sm-3">
                    <img src="images/fengmiantu.png "></img>
                    <p>今日<br>推荐</p>
                </div>
                <div class="am-u-sm-4 am-u-lg-3 " th:each="p1:${products1111}">
                    <div class="info ">
                        <h3>真的有鱼</h3>
                        <h4>开年福利篇</h4>
                    </div>
                    <div class="recommendationMain one">
                        <a target="_blank" th:href="'/product/'+${p1.id}"><img th:src="${p1.imgPath}"></a>
                    </div>
                </div>
                <div class="am-u-sm-4 am-u-lg-3 " th:each="p2:${products2222}">
                    <div class="info ">
                        <h3>囤货过冬</h3>
                        <h4>让爱早回家</h4>
                    </div>
                    <div class="recommendationMain two">
                        <a target="_blank" th:href="'/product/'+${p2.id}"><img th:src="${p2.imgPath}"></a>
                    </div>
                </div>
                <div class="am-u-sm-4 am-u-lg-3 " th:each="p3:${products3333}">
                    <div class="info ">
                        <h3>浪漫情人节</h3>
                        <h4>甜甜蜜蜜</h4>
                    </div>
                    <div class="recommendationMain three">
                        <a target="_blank" th:href="'/product/'+${p3.id}"><img th:src="${p3.imgPath}"></a>
                    </div>
                </div>

            </div>
            <div class="clear "></div>
            <!--热门活动 -->

            <div class="am-container activity ">
                <div class="shopTitle ">
                    <h4>活动</h4>
                    <h3>每期活动 优惠享不停 </h3>
                    <span class="more ">
                              <a href="# ">全部活动<i class="am-icon-angle-right" style="padding-left:10px ;"></i></a>
                        </span>
                </div>
                <div class="am-g am-g-fixed ">
                    <div class="am-u-sm-3 ">
                        <div class="icon-sale one "></div>
                        <h4>秒杀</h4>
                        <div class="activityMain ">
                            <img src="images/activity1.jpg "></img>
                        </div>
                        <div class="info ">
                            <h3>春节送礼优选</h3>
                        </div>
                    </div>

                    <div class="am-u-sm-3 ">
                        <div class="icon-sale two "></div>
                        <h4>特惠</h4>
                        <div class="activityMain ">
                            <img src="images/activity2.jpg "></img>
                        </div>
                        <div class="info ">
                            <h3>春节送礼优选</h3>
                        </div>
                    </div>

                    <div class="am-u-sm-3 ">
                        <div class="icon-sale three "></div>
                        <h4>团购</h4>
                        <div class="activityMain ">
                            <img src="images/activity3.jpg "></img>
                        </div>
                        <div class="info ">
                            <h3>春节送礼优选</h3>
                        </div>
                    </div>

                    <div class="am-u-sm-3 last ">
                        <div class="icon-sale "></div>
                        <h4>超值</h4>
                        <div class="activityMain ">
                            <img src="images/activity.jpg "></img>
                        </div>
                        <div class="info ">
                            <h3>春节送礼优选</h3>
                        </div>
                    </div>

                </div>
            </div>
            <div class="clear "></div>


            <!--一楼-->
            <div id="f1">
                <!--甜点-->
                <div class="am-container ">
                    <div class="shopTitle ">
                        <h4>饼干</h4>
                        <h3>每一块饼干都是优选</h3>
                        <div class="today-brands ">
                            <a href="# ">饼干</a>
                            <a href="# ">麻花</a>
                            <a href="# ">沙琪玛</a>
                            <a href="# ">膨化/薯片</a>
                            <a href="# ">肉松饼</a>
                        </div>
                        <span class="more ">
                    <a href="# ">更多美味<i class="am-icon-angle-right" style="padding-left:10px ;"></i></a>
                        </span>
                    </div>
                </div>
                <div class="am-g am-g-fixed floodFour">
                    <div class="am-u-sm-5 am-u-md-4 text-one list ">
                        <a href="# ">
                            <div class="outer-con ">
                                <div class="title ">
                                    开抢啦！
                                </div>
                            </div>
                            <img src="images/act1.png"/>
                        </a>
                        <div class="triangle-topright"></div>
                    </div>
                    <div class="am-u-sm-3 am-u-md-2 text-three big " th:each="p:${products}">

                        <div class="outer-con ">
                            <div class="title" th:text="${p.name}"></div>
                            <div class="sub-title">￥[[${p.price}]]</div>
                            <i class="am-icon-shopping-basket am-icon-md  seprate"></i>
                        </div>
                        <a target="_blank" th:href="'/product/'+${p.id}"><img th:src="${p.imgPath}"></a>
                    </div>
                </div>

                <div class="clear "></div>
            </div>


            <div id="f2">
                <!--坚果-->
                <div class="am-container ">
                    <div class="shopTitle ">
                        <h4>坚果</h4>
                        <h3>酥酥脆脆 回味无穷</h3>
                        <div class="today-brands ">
                            <a href="# ">腰果</a>
                            <a href="# ">松子</a>
                            <a href="# ">夏威夷果 </a>
                            <a href="# ">碧根果</a>
                            <a href="# ">开心果</a>
                            <a href="# ">核桃仁</a>
                        </div>
                        <span class="more ">
                    <a href="# ">更多美味<i class="am-icon-angle-right" style="padding-left:10px ;"></i></a>
                        </span>
                    </div>
                </div>
                <div class="am-g am-g-fixed floodFour">
                    <div class="am-u-sm-5 am-u-md-4 text-one list ">
                        <a href="# ">
                            <div class="outer-con ">
                                <div class="title ">
                                    坚果好货!等你来！
                                </div>
                            </div>
                            <img src="images/act3.png"/>
                        </a>
                        <div class="triangle-topright"></div>
                    </div>
                    <div class="am-u-sm-3 am-u-md-2 text-three big " th:each="p:${products2}">

                        <div class="outer-con ">
                            <div class="title" th:text="${p.name}"></div>
                            <div class="sub-title">￥[[${p.price}]]</div>
                            <i class="am-icon-shopping-basket am-icon-md  seprate"></i>
                        </div>
                        <a target="_blank" th:href="'/product/'+${p.id}"><img th:src="${p.imgPath}"></a>
                    </div>
                </div>

                <div class="clear "></div>
            </div>


            <div id="f3">
                <!--蛋糕-->
                <div class="am-container ">
                    <div class="shopTitle ">
                        <h4>蛋糕<</h4>
                        <h3>每一块蛋糕都有一个故事</h3>
                        <div class="today-brands ">
                            <a href="# ">蛋黄派</a>
                            <a href="# ">蛋卷</a>
                            <a href="# ">面包 </a>
                            <a href="# ">糕点</a>
                        </div>
                        <span class="more">
                    <a href="# ">更多美味<i class="am-icon-angle-right" style="padding-left:10px ;"></i></a>
                        </span>
                    </div>
                </div>
                <div class="am-g am-g-fixed floodFour">
                    <div class="am-u-sm-5 am-u-md-4 text-one list ">
                        <a href="# ">
                            <div class="outer-con">
                                <div class="title">
                                    流心蛋黄酥 香甜美味
                                </div>
                            </div>
                            <img src="images/mianbao1.png"/>
                        </a>
                        <div class="triangle-topright"></div>
                    </div>
                    <div class="am-u-sm-3 am-u-md-2 text-three big " th:each="p:${products3}">

                        <div class="outer-con ">
                            <div class="title" th:text="${p.name}"></div>
                            <div class="sub-title">￥[[${p.price}]]</div>
                            <i class="am-icon-shopping-basket am-icon-md  seprate"></i>
                        </div>
                        <a target="_blank" th:href="'/product/'+${p.id}"><img th:src="${p.imgPath}"></a>
                    </div>
                </div>

                <div class="clear "></div>
            </div>


            <div class="clear "></div>
        </div>

        <!--尾部导航-->
        <th:block th:include="footer"/>

    </div>
</div>
<!--引导 -->
<div class="navCir">
    <li class="active"><a href="index.html"><i class="am-icon-home "></i>首页</a></li>
    <li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
    <li><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>
    <li><a href="person/index.html"><i class="am-icon-user"></i>我的</a></li>
</div>


<!--菜单 -->
<div class=tip>
    <div id="sidebar">
        <div id="wrap">

            <div id="shopCart " class="item ">
                <a href="# ">
                    <span class="message "></span>
                </a>
                <p>
                    购物车
                </p>
                <p class="cart_num "></p>
            </div>

            <div class="quick_toggle ">
                <!--二维码 -->
                <li class="qtitem ">
                    <a href="#none "><span class="mpbtn_qrcode "></span></a>
                    <div class="mp_qrcode " style="display:none; "><img src="images/weixin_code_145.png "/><i
                            class="icon_arrow_white "></i></div>
                </li>
                <cli class="qtitem ">
                    <a href="#top " class="return_top "><span class="top "></span></a>
                </cli>
            </div>

            <!--回到顶部 -->
            <div id="quick_links_pop " class="quick_links_pop hide "></div>

        </div>

    </div>
    <div id="prof-content " class="nav-content ">
        <div class="nav-con-close ">
            <i class="am-icon-angle-right am-icon-fw "></i>
        </div>
        <div>
            我
        </div>
    </div>
    <div id="shopCart-content " class="nav-content ">
        <div class="nav-con-close ">
            <i class="am-icon-angle-right am-icon-fw "></i>
        </div>
        <div>
            购物车
        </div>
    </div>
    <div id="foot-content " class="nav-content ">
        <div class="nav-con-close ">
            <i class="am-icon-angle-right am-icon-fw "></i>
        </div>
        <div>
            足迹
        </div>
    </div>
    <div id="brand-content " class="nav-content ">
        <div class="nav-con-close ">
            <i class="am-icon-angle-right am-icon-fw "></i>
        </div>
        <div>
            收藏
        </div>
    </div>

</div>
<!--		<script>-->
<!--			window.jQuery || document.write('<script src="basic/js/jquery.min.js "></script>');-->
<!--		</script>-->
<script type="text/javascript " src="/basic/js/quick_links.js "></script>
</div>
<script src="/layui/layui.js"></script>
<script type="text/html" id="categoryTemplate">
    {{#  layui.each(d,function(index,item){   }}
    <li class="appliance js_toggle relative">
        <div class="category-info">
            <h3 class="category-name b-category-name"><i><img src="/images/cookies.png"></i><a class="ml-22"
                                                                                               title="饼干">{{=item.name}}</a>
            </h3>
            <em><</em>
        </div>
        <div class="menu-item menu-in top">
            <div class="area-in">
                <div class="area-bg">
                    <div class="menu-srot">
                        <div class="sort-side">
                            {{# layui.each(item.children,function(i,v){ }}
                            <dl class="dl-sort">
                                <dd><a title="" href="/search/goods"><span>{{=v.name}}</span></a></dd>
                            </dl>
                            {{# }) }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <b class="arrow"></b>
    </li>
    {{#   })  }}
</script>
<script>
    layui.use(["layer", "laytpl"], function () {
        var layer = layui.layer;
        var laytpl = layui.laytpl;
        var $ = layui.jquery;
        //页面加载完成就发请求获取所有的分类数据
        $.get("/category/list", function (categories) {
            console.log(categories);
            //categories数据转化成html 在插入到 id：js_climit_li 里
            laytpl($("#categoryTemplate").html()).render(categories, function (a) {
                $("#js_climit_li").html(a);
            })
            $(document).ready(function () {
                $("li").hover(function () {
                    $(".category-content .category-list li.first .menu-in").css("display", "none");
                    $(".category-content .category-list li.first").removeClass("hover");
                    $(this).addClass("hover");
                    $(this).children("div.menu-in").css("display", "block")
                }, function () {
                    $(this).removeClass("hover")
                    $(this).children("div.menu-in").css("display", "none")
                });
            })
        });
    });
</script>
</body>

</html>